package cn.com.qtgl.apis.iam.comp;

import cn.com.qtgl.apis.iam.model.beans.IamConfigValue;
import cn.melonlib.apis.support.model.bean.ApiModuleConfig;
import cn.melonlib.cores.aop.anno.IgnorePrepend;
import cn.melonlib.cores.aop.anno.PrependUrl;
import cn.melonlib.cores.aop.enums.AccessTokenType;
import lombok.Getter;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.support.ApplicationObjectSupport;
import org.springframework.stereotype.Component;

@PrependUrl
@Component
@Getter
public class IamConfig extends ApplicationObjectSupport implements ApiModuleConfig {

    public static final String IAM="iamConfig";

    @Value("${apis.iam}")
    private String iam;

    public IamConfigValue getValue(){
        return new IamConfigValue(iam);
    }

    @Override

    public String getUrl() {
        return iam;
    }

    @Override
    @IgnorePrepend
    public String getName() {
        return "IAM";
    }

    @Override
    @IgnorePrepend
    public AccessTokenType accessTokenType() {
        return AccessTokenType.SYSTEM;
    }
}
